Part Number Hot Search : 
NTE137A KTK5131V 01006 2N3019 742C083 39202B 752B0 10U100
Product Description
Full Text Search
 

To Download AN10935 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  AN10935 using sdr/ddr sdram me mories with lpc32xx rev. 2 ? 11 october 2010 application note document information info content keywords lpc32x0, lpc32xx, lpc3220, lp c3230, lpc3240, lpc3250, sdr, sdram, ddr abstract this application note covers hardware related issues for interfacing sdr or ddr sdrams to the lpc32xx family microcontroller.
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 2 of 47 contact information for additional information, please visit: http://www.nxp.com for sales office addresses, please send an email to: salesaddresses@nxp.com revision history rev date description 2 20101011 ? add section 2.4 . ? updated table 6 . ? updated table 7 . 1 20100603 initial version
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx 1. introduction nxp?s lpc32x0 32-bit microcontroller was designed for embedded applications requiring high performance and low power consumpt ion. the lpc32x0 is based on the arm926ej-s cpu core with a vector floating point co-processor, and a large set of standard peripherals. the basic arm926ej-s cpu core implementation uses harvard architecture with a 5-stage pipeline, and has one 32 kb instruction cache and one 32 kb data cache. the arm926ej-s core also has an integral memory management unit (mmu) to provide the virtual memory ca pabilities required to support the multi- programming demands of modern operating sy stems. the lpc32x0 comes with internal static memory ranging between 128 kb to 256 kb. while this is enough memory for some embedded applications, many applications re quire larger amounts of memory. the lpc32x0 has an integrated external memory cont roller (emc) for interfacing to external memories. the lpc32x0 emc is an arm primecell multipor t memory controller peripheral offering support for asynchronous static memory dev ices such as ram, rom and flash, as well as dynamic memories such as single data rate (sdr) and double data rate (ddr) sdram. for external memory of 2 mb or la rger the most practical memories to use today are sdr or ddr sdram. this application note will focus on connectivi ty, initialization and board layout guidelines when using sdr and ddr memories with the lpc32x0. 2. external memory controller the lpc32x0 uses an expanded amba high-perf ormance bus (ahb) architecture known as multi-layer ahb. a mult i-layer ahb replaces the request/grant and arbitration mechanism used in a simple ahb with an interconnect matrix that moves arbitration out toward the slave devices. within the inte rconnect matrix each slave port has its own arbitration block. thus, if a cpu and a dma controller want access to the same memory, the interconnect matrix arbitrates between the two when granting access to the memory. the lpc32x0 has seven ahb masters: the cpu data bus, cpu instruction bus, two general purpose dma masters, ethernet contro ller, usb controller, and lcd controller. the ahb masters access external memory through the emc on one of three ahb slave ports. a block diagram of how the lpc32x0 bus masters connect to the emc through the multi-layer ahb interconne ct matrix is shown in fig 1 . the emc translates ahb master requests on the slave ahb ports for access to external memory into commands and data transactions that follow the selected memory protocol. AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 3 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx 2.1 emc pins the emc supports an sdr sdram memory bu s of either 16 or 32-bits wide or ddr sdram bus of 16 bits. additional signals are required for ddr sdram, which are brought out on the same pins as emc_d[16:18]. in ddr mode, emc_d bits 19 through 31 may be used as additional parallel i/o pins p3[12:0]. the function of each emc pin for static memory, sdr sdram and ddr sdram is shown in table 1 . the emc supports mixing static memory devices with eith er sdr sdram or ddr sdram on the same system memory bus. the static memory dat a bus width may be 8-bit, 16-bit or 32-bit when mixed with sdr sdram, but is limited to 8-bit or 16-bit when mixed with ddr sdram. sdr and ddr sdram are not allo wed to be mixed on the emc bus. fig 1. e mc multi-layer ahb interconnect matrix AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 4 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx tab le 1. emc pins in sram, sdr and ddr operating modes emc interface pin(s) static ram function sdr sdram function ddr sdram function emc_a[00] - emc_a[12] address bus, bits 0 to 12 addr ess bus, bits 0 to 12 address bus, bits 0 to 12 emc_a[13] address bus, bit 13 address bus, ba 0 address bus, ba 0 emc_a[14] address bus, bit 14 address bus, ba 1 address bus, ba 1 emc_a[15] - emc_a[23] address bus, bit 15 to 23 - - emc_d[00] - emc_d[15] data bus, bits 0 to 15 da ta bus, bits 0 to 15 data bus, bits 0 to 15 emc_d[16]/emc_dqs0 data bus, bit 16 data bus, bit 16 data strobe, lower byte emc_d[17]/emc_dqs1 data bus, bit 17 data bus, bit 17 data strobe, upper byte emc_d[18]/emc_clk_n data bus, bit 18 data bus, bit 18 inverted sdram clock emc_d[19] - emc_d[31] data bus bits 19 through 31 data bus bits 19 through 31 p3[12:0] emc_oe_n sram output enable - - emc_bls[0] - emc_bls[3] sram byte lane select 0-3 - - emc_cs[0]_n - emc_cs[3]_n sram chip select 0-3 - - emc_wr_n sram write strobe sdra m write strobe sdram write strobe emc_clk - sdram clock sdram clock emc_clkin - sdram clock feedback - emc_cke - sdram clock enable sdram clock enable emc_dycs[0]_n, emc_dycs[1]_n - sdram chip select 0-1 sdram chip select 0-1 emc_cas_n - sdram column address strobe sdram column address strobe emc_ras_n - sdram row address strobe sdram row address strobe emc_dqm[0] - emc_dqm[3] - sdram byte write mask 0 through 3 sdram byte write mask 0 through 3 AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 5 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx 2.2 maxi mum system sdram memory the lpc32x0 supports two dynamic memory chip selects, emc_dycs[1:0]_n. each chip select addresses 512 mb. however, the largest density sdram device supported by the emc is limited by 13 row address bits (8k rows), making the largest compatible sdram devices the 1 gbit device configured as 32m x 32 or 512 mbit configured as 16m x 32, 32m x 16 or 64m x 8. using thes e compatible sdram configurations the maximum amount of sdram that can be physica lly supported per chip select is limited to 256 mb, 128 mb or 64 mb depending on t he data width of the sdram device(s) and the total bus width of the system memory. the lpc32xx emc supports a 32-bit system memory bus for sdr, but supports only a 16-bit system memory bus for ddr. using ddr will limit the memory to half that of a comparable sdr system. mobile sdr and mobile ddr sdram devices are not produced in x8 data width, hence using mobile/low power sdram (1.8 v) will limit the system me mory to half that of a comparable standard sdram (2.5 v/3.3 v) system. the maximum s dr memory configurations per chip select is shown in table 2 , and the maximum ddr configurations per chip select are shown in table 3 . a system using both chip selects will support twice the memory listed in table 2 or table 3 . the sdram address ranges are shown using x8, x16 and x32 memory devices in table 4 . table 2. m aximum sdr sdram per chip select 32-bit system memory sdr sdram memory type example sdram sdram density devices used maximum memory standard (3.3 v) mt48lc64m8a2p 512 mbit (64m x 8) 4 256 mb low power (1.8 v) mt48h32m16lfbf 512 mbit (32m x 16) 2 128 mb low power (1.8 v) h55s1g22mfp 1 gbit (32m x 32) 1 128 mb 16-bit system memory sdr sdram memory type example sdram sdram density devices used maximum memory standard (3.3 v) mt48lc64m8a2p 512 mbit (64m x 8) 2 128 mb low power (1.8 v) mt48h32m16lfbf 512 mbit (32m x 16) 1 64 mb table 3. m aximum ddr sdram per chip select 16-bit system memory ddr sdram memory type example sdram sdram density devices used maximum memory standard (2.5 v) mt46v64m8p 512 mbit (64m x 8) 2 128 mb low power (1.8 v) mt46h32m16lfbf 512 mbit (32m x 16) 1 64 mb AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 6 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx tab le 4. physical sdram address mapping chip select ahb address address range x16 system data bus address range x32 system data bus (sdr only) 512 mbit sdram (32m x 16) 512 mbit sdram (64m x 8) 512 mbit sdram (16m x 32) 512 mbit sdram (32m x 16) 512 mbit sdram (64m x 8) 64 mb 128 mb 64 mb 128 mb 256 mb emc_dycs[1]_n 0xbfff ffff 0xa000 0000 0xa3ff ffff 0xa000 0000 0xa7ff ffff 0xa000 0000 0xa3ff ffff 0xa000 0000 0xa7ff ffff 0xa000 0000 0xafff ffff 0xa000 0000 emc_dycs[0]_n 0x9fff ffff 0x8000 0000 0x83ff ffff 0x8000 0000 0x87ff ffff 0x8000 0000 0x83ff ffff 0x8000 0000 0x87ff ffff 0x8000 0000 0x8fff ffff 0x8000 0000 2.3 contiguous sdram across em c_dycs0 and emc_dycs1 sometimes to have enough system memo ry both emc_dycs0 and emc_dycs1 must be used. since the physical s dram addressing range will always be smaller than the ahb address range allotted to emc_dycs0, as shown in table 4 , the physical sdram will have mirrored address rang es across the full emc_dycs0 space. to make the memory appear contiguous the emc_dycs 0 sdram can be addressed at the largest mirrored address space. for example if a 32mx16 mobile ddr were placed on each emc_dycsx, the contiguous address range for the combined memories would be 0x9c00 0000 to 0xa3ff ffff. 2.4 sd ram clock enable when using emc_dycs0 and emc_dycs1 for systems using both chip selects, emc_dycs0_n and emc_dycs1_n, the lpc32x0 signal cke0 should be connected to all sdrams on emc_dyc0_n and signal cke1 should be connected to all sdrams on emc_dyc1_n as shown in fig 2 . this will enable sdrams on both chip selects to be placed in self-refresh mode, and will allow use of the dynamic memory clock enable bi t in the emcdynamiccontrol register to negate clock enable of an idle dynamic chip select to reduce overall system power. this applies to sdram, mobile sdra m, ddr and mobile ddr alike. fig 2. sdram clock enable connections in dual dynamic chip select system AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 7 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx 2.5 sdr sdram connections the lpc32x0 emc supports either a 16-b it wide or 32-bit wide system sdr sdram bus. the system sdr sdram bus may be constructed with: ? one 32-bit wide sdr sdram ? on e or two 16-bit wide sdr sdrams ? two or four 8-bit wide sdr sdrams connections to a single x32 sdr sdram is shown in fig 3 . using a single x32 sdr the maximum memory for each emc_dycs[1:0]_n is 64 mb (16m x 32). a 32-bit system data bus using two x16 sdr sdrams is shown in fig 4 . using two x16 sdrs the maximum memory for each emc_dycs[1:0]_n is 128 mb (two 32m x 16). using four x8 sdrs the maximum memory for each emc_dycs[1:0]_n is 256 mb (four 64m x 8). (1) for exceptions to ba[1:0] connect ed to emc_a[14:13] respectively, see section 2.12 fig 3. sdr x32 device connections AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 8 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx (1) fo r exceptions to ba[1:0] connect ed to emc_a[14:13] respectively, see section 2.12 fig 4 . sdr x16 device connections 2.5.1 routing rules for sdr sdram when using multiple sdr sdram configuratio ns it is best to place all memories near each other and route address, control and clo ck signals in a ?y? topology. keep as much of the overall trace length in the trunk of the ?y? as possible, and the length to each device after the split as short as possible. ma tch the trace length to each device to within 0.3?. rule 1: match emc_data[7:0], emc_dqm0 to within 0.3 inches of each other. rule 2: match emc_data[15:8], emc_dqm1 to within 0.3 inches of each other. rule 3: match emc_data[23:16], emc_dqm2 to within 0.3 inches of each other. rule 4: match emc_data[31:24], emc_dqm3 to within 0.3 inches of each other. rule 5: match signal groups from rule 1 through rule 4 to within 1.0 inches of each other. rule 6: match emc_clk to within +-0.30 inches of signal groups rule 1 through rule 4. rule 7: match emc_a[14:0], emc_ras, emc_cas, emc_dycs[1:0]_n, emc_wr_n, emc_cke[1:0] to within +- 0.500 inches of emc_clk. AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 9 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx 2.5.2 function of emc_clkin pin the emc_clkin pin is the mpmc data-in-clock during sdr sdram reads. after a sdr sdram read command is issued, the mpmc w ill latch burst data on the rising edge of emc_clkin after the number of cas latency clock cycles has elapsed (see um emcdynamicrascas). an external clock pin provides a way to compensate for signal flight delay times when the sdr sdram is placed far enough from the lpc32x0 that data being read does not arrive in time to meet the emc sdr sdram tsu(d) data input set-up time for the tck emc_clk period. most embedded system designs can tie emc_clkin (bga ball t4) directly to the emc_clk pin (bga ball t3). here?s an example of how long the traces can be before needing to route emc_clkin differently than just connecting dire ctly to the adjacent emc_clk pin. example parameters: ? sdr sdram maximum access time = 5.4 ns (sdram datasheet) ? lpc32x 0 tsu(d) data in set-up time = 0.6 ns ? emc-c lk period tck = 7.5 ns; (133 mhz) the allowed combined flight time and board signal jitter must be less than the emc_clk period minus the combined sdram access time and lpc32x0 data in set-up time. therefore, flight + jitter = 7.5 ns ? 6 ns = 1. 5 ns. reserving 300 ps for jitter leaves 1.2 ns for round trip flight time. assuming the si gnal travels on the pcb at 167 ps/inch we can have a total trace length of 600 ps/167 ps = 3.6 inches between the lpc32x0 and the sdr sdram. the allowable trace length without compensation will increase as the emc_clk period increases. with an emc_ clk period of 9.6 ns (104 mhz), the allowable trace length would be 9.9 inches. 2.5.2.1 emc_clkin to compensate for long flight times to compensate flight delay times longer t han will work for a given tck period and sdr sdram access time, the emc_clk is split routed with equal length traces to the sdr sdram and emc_clkin each with a series source termination, as shown in fig 5 . the series termination resistor value is dependent on the pcb trace characteristic impedance. the 0 ohm termination is used wh en the trace impedance is near 50 ohms, while 22 ohms is used when trace impedance is near 75 ohms. the extra trace length to emc_clkin compensates for one way signal flight time. so the example above would now meeting timing with up to 7.2 inches of trace length with tck = 7.5 ns. f ig 5. compensate signal flight time with emc_clkin AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 10 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx 2.6 ddr sdram connections the lpc32x0 emc supports only a 16-bit wide system ddr sdram bus. the system ddr sdram bus may be constructed with: ? on e 16-bit wide ddr sdram ? two 8- bit wide ddr sdrams connections to a single x16 ddr sdram are shown in fig 6 . using a single x16 ddr, the maximum memory for each emc_dycs[1:0]_n is 64 mb (32m x 16). a 16-bit system data bus using two x8 ddr sdrams is shown in fig 7 . using two x8 ddrs, the maximum memory for each emc_dycs[1:0]_n is 128 mb (two 64m x 8). connections to a single x16 mobile ddr sdram is shown in fig 8 . please see the lpc32xx errata ddr.1 for using a single ended clock with 2.5v ddr, and ddr.2 for routing dqsx to increase ddr dx to dqx data output set-up time. the errata sheet can be found at http://www.nxp.com/documents/ errata_sheet/es_lpc3250.pdf . (1) for exceptions to ba[1:0] connect ed to emc_a[14:13] respectively, see section 2.12 fig 6. d dr x16 device connections AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 11 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx (1) for exceptions to ba[1:0] connect ed to emc_a[14:13] respectively, see section 2.12 fig 7. d dr x8 connections AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 12 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx (1) for exceptions to ba[1:0] connect ed to emc_a[14:13] respectively, see section 2.12 fig 8. mobile ddr x16 device connections 2.7 routing rules for ddr sdram when using multiple ddr sdram configuratio ns it is best to place all memories near each other and route address, c ontrol and clock signals in a ?y? topology with as much of the overall trace length in the trunk of t he ?y? keeping the length to each device after the split as short as possible wh ile matching trace length to each device within 0.15?. please see the lpc32xx errata ddr.2 for routing dqsx to increase ddr dx to dqx data output set-up time. rule 1: match emc_data[7:0], emc_dqm0 to within 0.15 inches of each other. rule 1a: emc_dqs0, should be a minimum of 2.0? longer, but not more than 4.0? longer than emc_data[7:0], emc_dqm0. rule 2: match emc_data[15:8], emc_dqm1 to within 0.15 inches of each other. rule 2a: emc_dqs1 should be a minimum of 2.0? longer, but not more than 4.0? longer than emc_data[15:8], emc_dqm1. rule 3: match signal groups from rule 1 and rule 2 to within 0.50 inches of each other. rule 4: match emc_clk and ddr_nclk to with in +-0.30 inches of signal groups from rule 1 and rule 2. emc_clk and ddr_nclk together make a differential pair and AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 13 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx should be matched length to within 0.150 inches of each other. note: please see the lpc32xx errata ddr.1 for using a single ended clock for 2.5v ddr. rule 5: match emc_a[14:0], emc_ras, emc_cas, emc_dycs[1:0]_n, emc_wr_n, emc_cke[1:0] to within +- 0.500 inches of emc_clk. 2.7.1 function of emc_clkin pin emc_clkin is not used for ddr sdram conf igurations and should be tied to gnd or vdd_emc. 2.8 sdram layout optimization configuring the system memory using a singl e chip select for sdram instead of two dynamic chip selects will help keep the r outing for dq[31:0], dqm[3:0] and dqs[1:0] signals point to point, a good topology for signal integrity. for example, placing two 512 mbit (64m x 8) ddr devices on a single chip select for 128 mb of system memory is more desirable than building the same system using two chip selects, each with a 512 mbit (32m x 16) device. 2.9 shar ed bus placement for sdram and static memory devices it is best if the sdr/ddr sdram is routed point-to-point between the lpc3250. if the lpc3250 emc bus is shared between sdram and static memory, nor flash, or memory mapped io devices, it is recommended to buffer the static memory and memory mapped io devices keeping just the sdra m memory and buffer directly connected to the lpc3250. when it is necessary to have an additional device on the emc bus it is recommended to place the lpc32xx at one ex treme on the bus and the sdram at the other extreme. the additional nor flash or buffer should be place nearer to the sdram and the bus routed in daisy chain fashion with stubs no longer than 0.3?. 2.10 add ress mapping between ahb address and sdr/ddr sdram the sdram memory is arranged in a xy grid pattern of rows and columns. first, the row address is sent to the memory chip and latc hed, then the column address is sent in a similar fashion. this row and column-addre ssing scheme (called multiplexing) allows a large memory address to use fewer pins. t he emc uses emcdynamicconfig register address mapping (am) field to map the ah b address for a specific sdram bank, row and column configuration. the value for the emcdynamicconfig am field, for each sdram configuration, is found in the lpc32xx user manual ?um10326? table 115 address mapping. the emc uses the am field bits 13:12 to determine the order in which the sdram bank, row and column address bits are mapped to the ahb address bits. the emc will always map the least significant ahb address bits to the sdram column address. when the am field bits 13:12 = 0b01 (low-power mapping) the sdram row address is mapped to the next significant group of ahb address bits and the sdram bank address bits are mapped to the most si gnificant ahb address bits. this is also referred to as bank-row-column (brc) mapping. when am field bits 13:12 = 0b00 (high performance mapping) the sdram bank address bits are mapped to the next significant ahb address bits after the column address and the sdram row address is mapped to the most significant ahb address bits. this is also referred to as row-bank-column (rbc) mapping. the detailed ahb address m apping for 16-bit system memory data bus is shown in table 5 and table 6 . the detailed ahb address mapping for 32-bit system memory data bus is shown in table 7 and table 8 . each emc_dyncs[1:0]_n has its own emcdynamicconfig register, so each chip select may use a different sdram AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 14 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx density with different row and column conf iguration. the mpmc maps the sdram auto precharge bit to emc_a10 during sram read, write and precharge commands. table 5. 1 6-bit wide system data bus high perf ormance ahb address mapping to sdram pins (rbc) 16-bit wide system data bus high performance ahb address mapping to sdram pins (row, bank, column) 2 mb using 16-bit wide device 16 mbit sdr/ddr sdram (1m x 16) rbc (banks = 2, ro ws = 11, columns = 8) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 9 - - - 20 19 18 17 16 15 14 13 12 11 10 ahb address to column address 9 - - - ap - - 8 7 6 5 4 3 2 1 sdram device connections ba - - - 10/ap 9 8 7 6 5 4 3 2 1 0 4 mb using two 8-bit wide devices 16 mbit sdr/ddr sdra m (2m x 8) rbc (banks = 2, rows = 11, columns = 9) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address - 10 - - 21 20 19 18 17 16 15 14 13 12 11 ahb address to column address - 10 - - ap - 9 8 7 6 5 4 3 2 1 sdram device connections - ba - - 10/ap 9 8 7 6 5 4 3 2 1 0 8 mb using 16-bit wide device 64 mbit sdr/ddr sdram (4m x 16) rbc (banks = 4, ro ws = 12, columns = 8) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 9 10 - 22 21 20 19 18 17 16 15 14 13 12 11 ahb address to column address 9 10 - - ap - - 8 7 6 5 4 3 2 1 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 16 mb using two 8-bit wide devices 64 mbit sdr/ddr sdra m (8m x 8) rbc (banks = 4, rows = 12, columns = 9) 16 mb using 16-bit wide device 128 mbit sdr/ddr sdram (8m x 16) rbc (banks = 4, ro ws = 12, columns = 9) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 11 10 - 23 22 21 20 19 18 17 16 15 14 13 12 ahb address to column address 11 10 - - ap - 9 8 7 6 5 4 3 2 1 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 15 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx table 5. 16-bit wide system data bus high performan ce ahb address mapping to sd ram pins (rbc) ...continued 32 mb using two 8-bit wide devices 128 mbit sdr/ddr sdra m (16m x 8) rbc (banks = 4, rows = 12, columns = 10) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 11 12 - 24 23 22 21 20 19 18 17 16 15 14 13 ahb address to column address 11 12 - - ap 10 9 8 7 6 5 4 3 2 1 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 32 mb using 16-bit wide device 256 mbit sdr/ddr sdram (1 6m x 16) rbc (banks = 4, ro ws = 13, columns = 9) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 11 10 24 23 22 21 20 19 18 17 16 15 14 13 12 ahb address to column address 11 10 - - ap - 9 8 7 6 5 4 3 2 1 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 64 mb using 16-bit wide device 512 mbit sdr/ddr sdram (3 2m x 16) rbc (banks = 4, ro ws = 13, columns = 10) 64 mb using two 8-bit wide devices 256 mbit sdr/ddr sdra m (32m x 8) rbc (banks = 4, rows = 13, columns = 10) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 11 12 25 24 23 22 21 20 19 18 17 16 15 14 13 ahb address to column address 11 12 - - ap 10 9 8 7 6 5 4 3 2 1 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 128 mb using two 8-bit wide devices 512 mbit sdr/ddr sd ram (64m x 8) rbc (banks = 4, rows = 13, columns = 11) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 13 12 26 25 24 23 22 21 20 19 18 17 16 15 14 ahb address to column address 13 12 - 11 ap 10 9 8 7 6 5 4 3 2 1 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 16 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx table 6. 1 6-bit wide system data bus low-power ahb address mapping to sdram pins (brc) 16-bit wide system data bus low-power ahb address mapping to sdram pins (bank, row, column) 2 mb using 16-bit wide device 16 mbit sdr/ddr sdram (1m x 16) brc (banks = 2, ro ws = 11, columns = 8) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address - 20 - - 19 18 17 16 15 14 13 12 11 10 9 ahb address to column address - 20 - - ap - - 8 7 6 5 4 3 2 1 sdram device connections - ba - - 10/ap 9 8 7 6 5 4 3 2 1 0 4 mb using two 8-bit wide devices 16 mbit sdr/ddr sdra m (2m x 8) brc (banks = 2, rows = 11, columns = 9) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 21 - - - 20 19 18 17 16 15 14 13 12 11 10 ahb address to column address 21 - - - ap - 9 8 7 6 5 4 3 2 1 sdram device connections ba - - - 10/ap 9 8 7 6 5 4 3 2 1 0 8 mb using 16-bit wide device 64 mbit sdr/ddr sdram (4m x 16) brc (banks = 4, ro ws = 12, columns = 8) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 21 22 - 20 19 18 17 16 15 14 13 12 11 10 9 ahb address to column address 21 22 - - ap - - 8 7 6 5 4 3 2 1 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 16 mb using 16-bit wide device 128 mbit sdr/ddr sdram (8m x 16) brc (banks = 4, ro ws = 12, columns = 9) 16 mb using two 8-bit wide devices 64 mbit sdr/ddr sdra m (8m x 8) brc (banks = 4, rows = 12, columns = 9) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 23 22 - 21 20 19 18 17 16 15 14 13 12 11 10 ahb address to column address 23 22 - - ap - 9 8 7 6 5 4 3 2 1 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 32 mb using 16-bit wide device 256 mbit sdr/ddr sdram (1 6m x 16) brc (banks = 4, ro ws = 13, columns = 9) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 23 24 22 21 20 19 18 17 16 15 14 13 12 11 10 ahb address to column address 23 24 - - ap - 9 8 7 6 5 4 3 2 1 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 17 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx table 6. 16-bit wide system data bus low-power a hb address mapping to sdra m pins (brc ) ...continued 32 mb using two 8-bit wide devices 128 mbit sdr/ddr sdra m (16m x 8) brc (banks = 4, rows = 12, columns = 10) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 23 24 - 22 21 20 19 18 17 16 15 14 13 12 11 ahb address to column address 23 24 - - ap 10 9 8 7 6 5 4 3 2 1 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 64 mb using 16-bit wide device 512 mbit sdr/ddr sdram (3 2m x 16) brc (banks = 4, ro ws = 13, columns = 10) 64 mb using two 8-bit wide devices 256 mbit sdr/ddr sdra m (32m x 8) brc (banks = 4, rows = 13, columns = 10) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 ahb address to column address 25 24 - - ap 10 9 8 7 6 5 4 3 2 1 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 128 mb using two 8-bit wide devices 512 mbit sdr/ddr sd ram (64m x 8) brc (banks = 4, rows = 13, columns = 11) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 25 26 24 23 22 21 20 19 18 17 16 15 14 13 12 ahb address to column address 25 26 - 11 ap 10 9 8 7 6 5 4 3 2 1 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 tabl e 7. 32-bit wide system data bus high perf ormance ahb address mapping to sdram pins (rbc) 32-bit wide system data bus high performance ahb address mapping to sdram pins (row, bank, column) 4 mb using two 16-bit wide devices 16 mbit sdr sdra m (1m x 16) rbc (banks = 2, rows = 11, columns = 8) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address - 10 - - 21 20 19 18 17 16 15 14 13 12 11 ahb address to column address - 10 - - ap - - 9 8 7 6 5 4 3 2 sdram device connections - ba - - 10/ap 9 8 7 6 5 4 3 2 1 0 8 mb using 32-bit wide device 64 mbit sdr sdram (2 m x 32) rbc (banks = 4, rows = 11, columns = 8) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 11 10 - - 22 21 20 19 18 17 16 15 14 13 12 ahb address to column address 11 10 - - ap - - 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 18 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx table 7. 32-bit wide system data bus high performa nce ahb address mapping to sdram pins (rbc)...continued 8 mb using four 8-bit wide devices 16 mbit sdr sdram (2m x 8) rbc (banks = 2, rows = 11, columns = 9) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 11 - - - 22 21 20 19 18 17 16 15 14 13 12 ahb address to column address 11 - - - ap - 10 9 8 7 6 5 4 3 2 sdram device connections ba - - - 10/ap 9 8 7 6 5 4 3 2 1 0 16 mb using 32-bit wide device 128 mbit sdr sdram (4 m x 32) rbc (banks = 4, ro ws = 12, columns = 8) 16 mb using two 16-bit wide devices 64 mbit sdr sdram (4m x 16) rbc (banks = 4, ro ws = 12, columns = 8) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 11 10 - 23 22 21 20 19 18 17 16 15 14 13 12 ahb address to column address 11 10 - - ap - - 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 32 mb using 32-bit wide device 256 mbit sdr sdram (8 m x 32) rbc (banks = 4, ro ws = 12, columns = 9) 32 mb using two 16-bit wide devices 128 mbit sdr sdram (8m x 16) rbc (banks = 4, ro ws = 12, columns = 9) 32 mb using four 8-bit wide devices 64 mbit sdr sdra m (8m x 8) rbc (banks = 4, rows = 12, columns = 9) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 11 12 - 24 23 22 21 20 19 18 17 16 15 14 13 ahb address to column address 11 12 - - ap - 10 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 32 mb using 32-bit wide device 256 mbit sdr sdram (8 m x 32) rbc (banks = 4, ro ws = 13, columns = 8) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 11 10 24 23 22 21 20 19 18 17 16 15 14 13 12 ahb address to column address 11 10 - - ap - - 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 64 mb using 32-bit wide devices 512 mbit sdr sdram ( 16m x 32) rbc (banks = 4, rows = 13, columns = 9) 64 mb using two 16-bit wide devices 256 mbit sdr sdram ( 16m x 16) rbc (banks = 4, rows = 13, columns = 9) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 11 12 25 24 23 22 21 20 19 18 17 16 15 14 13 ahb address to column address 11 12 - - ap - 10 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 19 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx table 7. 32-bit wide system data bus high performa nce ahb address mapping to sdram pins (rbc)...continued 64 mb using four 8-bit wide devices 128 mbit sdr sdra m (16m x 8) rbc (banks = 4, rows = 12, columns = 10) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 13 12 - 25 24 23 22 21 20 19 18 17 16 15 14 ahb address to column address 13 12 - - ap 11 10 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 128 mb using 32-bit wide device 1 gbit sdr sdram (3 2m x 32) rbc (banks = 4, ro ws = 13, columns = 10) 128 mb using two 16-bit wide devices 512 mbit sdr sdram ( 32m x 16) rbc (banks = 4, rows = 13, columns = 10) 128 mb using four 8-bit wide devices 256 mbit sdr sdram (32m x 8) rbc (banks = 4, rows = 13, columns = 10) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 13 12 26 25 24 23 22 21 20 19 18 17 16 15 14 ahb address to column address 13 12 - - ap 11 10 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 256mb using four 8-bit wide devices 512 mbit sdr sdram (64m x 8) rbc (banks = 4, rows = 13, columns = 11) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 13 14 27 26 25 24 23 22 21 20 19 18 17 16 15 ahb address to column address 13 14 - 12 ap 11 10 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 table 8. 3 2-bit wide system data bus low-power ahb address mapping to sdram pins (brc) 32-bit wide system data bus low-power ahb address mapping to sdram pins (bank, row, column) 4 mb using two 16-bit wide device 16 mbit sdr sdram (1m x 16) brc (banks = 2, rows = 11, columns = 8) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 21 - - - 20 19 18 17 16 15 14 13 12 11 10 ahb address to column address 21 - - - ap - - 9 8 7 6 5 4 3 2 sdram device connections ba - - - 10/ap 9 8 7 6 5 4 3 2 1 0 AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 20 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx table 8. 32-bit wide system data bus low-power a hb address mapping to sdra m pins (brc)...continued 8 mb using 32-bit wide device 64 mbit sdr sdram (2 m x 32) brc (banks = 4, rows = 11, columns = 8) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 21 22 - - 20 19 18 17 16 15 14 13 12 11 10 ahb address to column address 21 22 - - ap - - 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 8 mb using four 8-bit wide devices 16 mbit sdr sdram (2m x 8) brc (banks = 2, rows = 11, columns = 9) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address - 22 - - 21 20 19 18 17 16 15 14 13 12 11 ahb address to column address - 22 - - ap - 10 9 8 7 6 5 4 3 2 sdram device connections - ba - - 10/ap 9 8 7 6 5 4 3 2 1 0 16 mb using 32-bit wide device 128 mbit sdr sdram (4 m x 32) brc (banks = 4, ro ws = 12, columns = 8) 16 mb using two 16-bit wide devices 64 mbit sdr sdram (4m x 16) brc (banks = 4, ro ws = 12, columns = 8) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 23 22 - 21 20 19 18 17 16 15 14 13 12 11 10 ahb address to column address 23 22 - - ap - - 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 32 mb using 32-bit wide device 256 mbit sdr sdram (8 m x 32) brc (banks = 4, ro ws = 12, columns = 9) 32 mb using two 16-bit wide devices 128 mbit sdr sdram (8m x 16) brc (banks = 4, ro ws = 12, columns = 9) 32 mb using four 8-bit wide devices 64 mbit sdr sdra m (8m x 8) brc (banks = 4, rows = 12, columns = 9) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 23 24 - 22 21 20 19 18 17 16 15 14 13 12 11 ahb address to column address 23 24 - - ap - 10 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 32 mb using 32-bit wide device 256 mbit sdr sdram (8 m x 32) brc (banks = 4, ro ws = 13, columns = 8) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 23 24 22 21 20 19 18 17 16 15 14 13 12 11 10 ahb address to column address 23 24 - - ap - - 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 21 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx table 8. 32-bit wide system data bus low-power a hb address mapping to sdra m pins (brc)...continued 64 mb using 32-bit wide device 512 mbit sdr sdram (16m x 32) brc (banks = 4, rows = 13, columns = 9) 64 mb using two 16-bit wide devices 256 mbit sdr sdram ( 16m x 16) brc (banks = 4, rows = 13, columns = 9) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 ahb address to column address 25 24 - - ap - 10 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 64 mb using four 8-bit wide devices 128 mbit sdr sdra m (16m x 8) brc (banks = 4, rows = 12, columns = 10) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 25 24 - 23 22 21 20 19 18 17 16 15 14 13 12 ahb address to column address 25 24 - - ap 11 10 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 128 mb using 32-bit wide device 1 gbit sdr sdram (3 2m x 32) brc (banks = 4, ro ws = 13, columns = 10) 128 mb using two 16-bit wide devices 512 mbit sdr sdram ( 32m x 16) brc (banks = 4, rows = 13, columns = 10) 128 mb using four 8-bit wide devices 256 mbit sdr sdram (32m x 8) brc (banks = 4, rows = 13, columns = 10) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 25 26 24 23 22 21 20 19 18 17 16 15 14 13 12 ahb address to column address 25 26 - - ap 11 10 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 256mb using four 8-bit wide devices 512 mbit sdr sdram (64m x 8) brc (banks = 4, rows = 13, columns = 11) lpc address pin, emc_a[14:0] 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ahb address to row address 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 ahb address to column address 27 26 - 12 ap 11 10 9 8 7 6 5 4 3 2 sdram device connections ba1 ba0 - - 10/ap 9 8 7 6 5 4 3 2 1 0 AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 22 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx 2.11 using 32-bit sdrams not in um10326 table 115 address mapping there are certain available 256 mbit (8m x 32), 512 mbit (16m x 32) and 1 gbit (32m x 32) sdr sdrams that have a row and column configuration that is not listed in the um10326. these devices can be used by setti ng the emcdynamicconfig am field as if two 16-bit devices with the same bank/row/column mapping are being used, as shown in table 9 . ta ble 9. address mapping 32-bit sdram [14] [13:12] [11:9] [8:7] sdram device description 32-bit external bus high-performance address mapping (row, bank, column) 1 00 010 01 256 mbit (8mx32), 4 banks, row length = 12, column length = 9 1 00 011 01 512 mbit (16mx32), 4 banks, row length = 13, column length = 9 1 00 100 01 1 gbit (32mx32), 4 banks, row length = 13, column length = 10 32-bit external bus low-power address mapping (bank, row, column) 1 01 010 01 256 mbit (8mx32), 4 banks, row length = 12, column length = 9 1 01 011 01 512 mbit (16mx32), 4 banks, row length = 13, column length = 9 1 01 100 01 1 gbit (32mx32), 4 banks, row length = 13, column length = 10 2.12 special cases connecting sdram ba[1:0] to emc_a[14:13] the sdram bank select ba1:0 are always mapped to emc_a[14:13] regardless of how many address lines the sdram uses. however, the emc does not always map the least significant ahb address bit mapped for the sdram bank pins to emc_a13. of the two ahb address bits mapped to the emc_a[14:13] the even ahb address is always mapped to emc_a13 and the odd ahb address bit to emc_a14. for most applications connecting the sdram ba0 to emc_a13 and ba1 to emc_a14 works fine because crossing sdram bank boundaries can happen in any order. the three cases where it is important to know whether emc_a13 or emc_ a14 pin carries the least significant ahb address bit are: 1. when using 16 mbit density sdram. these have only a single bank address pin (ba). the sdram interface must conne ct the proper lpc32xx emc_a13 or emc_a14 to the sdram ba pin. locate which emc_a[14:13] pin carries the sdram ba from table 5 , table 6 , table 7 or table 8 . 2. t o address the extended mode register in the mobile sdr and all ddr sdrams. the extended mode register is typically addressed with one sdram bank address bit equal to 1 and the other 0. this is usually different between sdr and ddr devices. see your sdram datasheet to find how the ba1:0 must be set to load the extended mode word. the offset address of the sdram extended mode register is dependent on which ahb address bits are mapped to emc_a[14:13] pins and how these pins are connected to the sdram ba[1:0]. see section 2.13 on sdram mode register and extended mode register addressing. 3. whe n using the parti al-array self-refresh (pasr) power m anagement feature built in to 1.8 v mobile sdr and ddr sdrams the ahb address should be mapped linearly to the sdram. otherwise, if the sdram is placed in the self-refresh partial-array mode with only half the array refreshed, and the bank address bits are not mapped AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 23 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx linearly to the ahb address, what the sdra m refreshes will map to banks 0 and 2 in the lpc32xx address space. to ensure the ahb address is mapped linearly to the sdram, the 16/32-bit low power address mapping must be programmed in to emcdynamicconfig am field, and the hardwa re sdram interface must connect the sdram ba0 to emc_a14 or emc_a13 depending on which carries the least significant ahb address bit. for low-power ahb address to emc_a[14:13] mapping see table 6 or table 8 . 2.13 loading the sdram mode register or extended mode register the address used to load the sdram mode register (mr) or mobile sdr and ddr extended mode register (emr) is dependent on the sdram density, which address mapping is used (rbc or brc), and how the sdram ba[1:0] pins are connected to emc_a[14:13]. the value you wish to load at either the sdram mr or emr register must be shifted left the proper number of bits to occupy the row address bit positions (emc_a(12:0) pins) in the ahb addr ess to row address mapping found in table 5 , table 6 , table 7 or table 8 . the sdram ba[1:0] value will determine whet her the mode register (ba[1:0] = 0b00) or extended mode register (ba[1:0] = 0b10 or 0b01) is loaded. see the mobile/low power sdram datasheet to confirm the ba1:0 value to load the extended mode word. the address for the mode word operation is as follows: chip select 0: address = 0x80000000 + (mode_word << (offset)) chip select 1: address = 0xa0000000 + (mode_word << (offset)) the value can be determined with the following formulas: brc mapping/16-bit device: (o ffset) = (column bits) + 1 rbc mapping/16-bit device: (offset) = (column bits + bank bits ) + 1 brc mapping/32-bit device: (o ffset) = (column bits) + 2 rbc mapping/32-bit device: (offset) = (column bits + bank bits ) + 2 example: for a 16-bit device with 9 columns and 4 banks (2 bits of bank address) in rbc mapping on chip select 0 writing t he mode word 0x21, the physical mode word address is (0x80000000 + (0x21 << (9 +2 + 1) = 0x80021000. AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 24 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx the following example mappings show t he row/column/bank signal mapping of a sdram device and how it is derived from an internal bus address. example 1: 16-bit device, brc address mapping, columns = 8, rows = 11, banks = 2 for this device type, the following mapping applies: b rrrrrrrrrrr cccccccc 0 0 ---modeword 00000000 0 to program a mode word into the row mappi ng of the sdram device, the mode word would have to be programmed into the row field (?r?) of mapping. this corresponds to a total mode word shift of 9 bits. the mode word would have to be written at address (0x80000000 + (modeword << 9)) example 2: 16-bit device, rbc address mapping, columns = 9, rows = 13, banks = 4 for this device type, the following mapping applies: rrrrrrrrrrrrr bb ccccccccc 0 -----modeword 00 000000000 0 to program a mode word into the row mappi ng of the sdram device, the mode word would have to be shifted by 12 bits. the mode word would have to be written at address (0x80000000 + (modeword << 12)) example 3: 32-bit device, rbc address mapping, columns = 8, rows = 13, banks = 4 for this device type, the following mapping applies: rrrrrrrrrrrrr bb cccccccc 00 -----modeword 00 00000000 00 to program a mode word into the row mappi ng of the sdram device, the mode word would have to be shifted by 12 bits. the mode word would have to be written at address (0x80000000 + (modeword << 12)) example 4: 32-bit device, brc address mapping, columns = 9, rows = 13, banks = 4 for this device type, the following mapping applies: bb rrrrrrrrrrrrr ccccccccc 00 00 -----modeword 000000000 00 to program a mode word into the row mappi ng of the sdram device, the mode word would have to be shifted by 11 bits. the mode word would have to be written at address (0x80000000 + (modeword << 11)) AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 25 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx 2.13.1 example writing to mobile sdram mode register in 16-bit system memory writing 0x31 to the sdram mode register sets the following: ? burst length = 2 ? burst type = sequential ? cas latency = 3 ? operating mode = standard operation ? write burst mode = programmed burst length writing 0x20 to the sdram extended m ode register sets the following: ? partial array self-r efresh = all banks ? temperat ure compensated self-refresh = no effect, on die temperature sensor used ? driver s trength = half strength offset for sdr/ddr sdram mode register and extended mode register for the above example settings are given in table 10 and table 11 . the offset mode register address or the offset extended mode register address must be adjusted for other values written to the sdram mode register or extended mode register. tab le 10. 16-bit rbc address mapping for mode register, extended mode register offset sdram size (mbit) total sdram size bit places shifted (bit) offset mode register address [1] offset extended mode register address [1] 16 (2mx8) 4 mb 11 0x18800 n/a 16 (1mx16) 2 mb 10 0x0c400 n/a 64 (8mx8) 16 mb 12 0x31000 0x20800 [2] 64 (4mx16) 8 mb 11 0x18800 0x10200 [2] 0x10400 [3] 128 (16mx8) 32 mb 13 0x62000 0x40800 [2] 0x41000 [3] 128 (8mx16) 16 mb 12 0x31000 0x20800 [2] 256 (32mx8) 64 mb 13 0x62000 0x40800 [2] 0x41000 [3] 256 (16mx16) 32 mb 12 0x31000 0x20800 [2] 512 (64mx8) 128 mb 14 0xc4000 0x82000 [2] 512 (32mx16) 64 mb 13 0x62000 0x40800 [2] 0x41000 [3] AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 26 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx tab le 11. 16-bit brc address mapping for mode register, extended mode register offset sdram size (mbit) total sdram size bit places shifted (bit) offset mode register address [1] offset extended mode register address [1] 16 (2mx8) 4 mb 10 0x0c400 n/a 16 (1mx16) 2 mb 9 0x06200 n/a 64 (8mx8) 16 mb 10 0x0c400 0x0808000 [2] 64 (4mx16) 8 mb 9 0x06200 0x0204000 [2] 0x0404000 [3] 128 (16mx8) 32 mb 11 0x18800 0x0810000 [2] 0x1010000 [3] 128 (8mx16) 16 mb 10 0x0c400 0x0808000 [2] 256 (32mx8) 64 mb 11 0x18800 0x2010000 [2] 256 (16mx16) 32 mb 10 0x0c400 0x0808000 [2] 0x1008000 [3] 512 (64mx8) 128 mb 12 0x31000 0x2020000 [2] 0x4020000 [3] 512 (32mx16) 64 mb 11 0x18800 0x2010000 [2] [1] the base address for emc_dycs0_n is 0x80000000; the base address emc_dycs1_n = 0xa0000000. [2] of fset with emc_a14 connected to s dram ba1; emc_a13 connected to sdram ba0. [ 3] offset with emc_a14 connected to sdram ba0; emc_a13 connected to ba1 (linear address mapping). 2.13.2 example writing to mobile sdram mode register in 32-bit system memory writing 0x20 to the sdram mode register sets the following: ? burst length = 1 ? burst type = sequential ? cas latency = 3 ? operating mode = standard operation ? write burst mode = programmed burst length writing 0x20 to the sdram extended m ode register sets the following: ? partial array self-r efresh = all banks ? temperat ure compensated self-refresh = no effect, on die temperature sensor used ? driver s trength = half strength AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 27 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx offset for sdr/ddr sdram mode register and extended mode register settings are given in table 12 and table 13 . tab le 12. 32-bit rbc address mapping for mode register, extended mode register offset sdram size (mbit) total sdram size bit places shifted (bit) offset mode register address [1] offset extended mode register address [1] 16 (2mx8) 8 mb 12 0x030000 n/a 16 (1mx16) 4 mb 11 0x018000 n/a 64 (8mx8) 32 mb 13 0x060000 0x040800 [2] 0x041000 [3] 64 (4mx16) 16 mb 12 0x030000 0x020800 [2] 64 (2mx32) 8 mb 12 0x030000 0x020800 [2] 128 (16mx8) 64 mb 14 0x0c0000 0x082000 [2] 128 (8mx16) 32 mb 13 0x060000 0x040800 [2] 0x041000 [3] 128 (4mx32) 16 mb 12 0x030000 0x020800 [2] 256 (32mx8) 128 mb 14 0x0c0000 0x082000 [2] 256 (16mx16) 64 mb 13 0x060000 0x040800 [2] 0x041000 [3] 256 (8mx32) 32 mb 12 0x030000 0x020800 [2] 512 (64mx8) 256mb 15 0x180000 0x102000 [2] 0x104000 [3] 512 (32mx16) 128 mb 14 0x0c0000 0x082000 [2] AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 28 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx tab le 13. 32-bit brc address mapping for mode register, extended mode register offset sdram size (mbit) total sdram size bit places shifted (bit) offset mode register address [1] offset extended mode register address [1] 16 (2mx8) 8 mb 11 0x018000 n/a 16 (1mx16) 4 mb 10 0x00c000 n/a 64 (8mx8) 32 mb 11 0x018000 0x0810000 [2] 0x1010000 [3] 64 (4mx16) 16 mb 10 0x00c000 0x0808000 [2] 64m (2mx32) 8 mb 10 0x00c000 0x0208000 [2] 0x0408000 [3] 128 (16mx8) 64 mb 12 0x030000 0x2020000 [2] 128 (8mx16) 32 mb 11 0x018000 0x0810000 [2] 0x1010000 [3] 128 (4mx32) 16 mb 10 0x00c000 0x0808000 [2] 256 (32mx8) 128 mb 12 0x030000 0x2020000 [2] 0x4020000 [3] 256 (16mx16) 64 mb 11 0x018000 0x2010000 [2] 256 (8mx32) 32 mb 10 0x00c000 0x0808000 [2] 0x1008000 [3] 512 (64mx8) 256mb 13 0x060000 0x8040000 [2] 512 (32mx16) 128 mb 12 0x030000 0x2020000 [2] 0x4020000 [3] [1] the base address for emc_dycs0_n is 0x80000000; the base address emc_dycs1_n = 0xa0000000. [2 ] offset with emc_a14 connected to s dram ba1; emc_a13 connected to sdram ba0. [3] offset with emc_a14 connected to sdram ba0; emc_a13 connected to ba1 (linear address mapping). AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 29 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx 3. sdram controller programming and operations sdram devices are more complex to setup than standard asynchronous memories. in addition to setting up the interface signal timings ? factors such as ras and cas latency (also referred to as ras and cas delay), burst size, and refresh timing need to be considered. for ddr based memories that r un at high clock frequencies, the correct setup of the self calibration features in the lpc32x0 also become important for normal operation. sdram setup is procedural and requires a seri es of steps to initialize and configure sdram. 3.1 typical sdram programming sequences to program the sdram controller for a specif ic sdram device, the following information about the system using the sdram devices is needed: ? desired clock speed for the sdram access speed ? in sdr based systems, this can be up to the cpu clock rate, ? the cpu clock rate, or ? the cpu clock rate ? in ddr systems, the ddr clock can only run at ? or ? the cpu clock speed. ? sdram types (voltage) ? low power (mobile) or standar d drams, sdr or ddr sdram ? sdram geometry ? number of columns, rows, and banks of the device ? expected ras and cas cycles (may be lim ited by memory speed and board design) ? sdram access (or address) strategy: low-power or high-performance mode ? sdram data bus width ? sdra m interface timings (from the sdram datasheet) ? dynamic refresh period timing sdr and ddr sdram types are slightly diffe rent in their programming sequence. these programming sequences are meant as guidelines only. 3.1.1 standard and low power sdr sdram programming sequence following are the typical steps necessary to program the sdram controller and a sdr sdram type device. prior to these steps, it is assumed the main system clocking has already been setup and the system is running at the desired clock rate. for this type of sdram, the bus clock (hclk) used to driv e the sdram can run at up to 133 mhz at a ratio of 1, ?, or ? the cpu speed. note the programming sequence defined below is based on the jdec programming sequence and includes the proper steps to setup the sdram and the controller. low power and standard sdr sdram programming sequences are similar, with the exception of an extra ext ended mode register programming cycle on low power devices. step 1: enable emc clocking, select sd ram type, and select sdram slew rates before any accesses to the emc can occur, the emc clock needs to be enabled. the emc clock can be enabled by clearing bit 0 in the clock and power sdram clock control register. sdr sdram must also be select ed in this register by clearing bit 1. slew rates can also be set to fast or sl ow in this register with bits 22..20. AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 30 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx step 2: enable the emc interface and set emc endian-ness the emc interface can be enabled by setting bit 0 of the emc control register. the endian mode can be selected by the emc confi guration register. in most cases, little endian mode should be used. step 3: set a long period for the dynamic refresh rate setting a long period for the dynamic refres h rate prevents the emc from constantly being in the busy status. set the emc dynamic memory refresh timer register to 0x7ff for the maximum period. step 4: set the hclk command delay to 7 and select sdr memory program a hard-coded value of 7 for the command delay field (bits 18..14) in the sdram clock control regist er. sdr memory is selected by clearing bit 1. step 5: setup address mapping setup the row/column/bank address mapping and dram type used by the interface. this can be selected with configuring the emc dy namic memory configuration 0 register. for sdr sdram, always use the low power s dr sdram value for the memory device (md) field (bits 2..0) of this register, regardless of whether standard or low power sdram is used in the system. for the address mapping (am) field (bits 14..7), select a device that matches the sdram data bus width (16 or 32-bits) and has the same row/column/bank numbers as the sdram device(s). note the listed size for a mapping isn?t important, only the row/column/bank mapping must match for the selected data bus width. multiple configurations may exist with the same m apping, but different listed sizes. either mapping will work. if a device also exists on the 2 nd sdram chip select, it also needs address mapping to be setup in the emc dy namic memory configuration 1 register. step 6: setup ras and cas latencies setup the ras and cas latencies in the emc dynamic memory ras and cas delay 0 register. note the cas latency supports ? cl ock latencies. for sdr sdram devices, the cas latency must be setup in full clock cycles and bit 7 in the cas latency field must always be 0. if a device also exists on the 2 nd sdram chip select, it also needs cas and ras latency to be setup in the emc dynamic memory ras and cas delay 1 register. step 7: setup the sdram command and read strategy this can be setup in the emc dynamic memo ry read configuration register. for the sdr_srp and sdr_srd fields, the positive capture edge and ?command delayed by command_delay time? must be used, respectively. AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 31 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx step 8: setup interface timing setup the interface timing parameters fo r the sdram device in the emc dynamic memory timing registers. these registers control the number of bus clocks cycles a specific timing value is delayed. the value for these registers van be obtained from the user?s guide or datasheet for the sdram devic e. a list of the registers that need to be setup is shown below: ? precharge command period register ? active to precharge command period register ? self-refresh exit time register ? write recover time register ? active to active command period register ? exit self-refresh to active command register ? active bank a to active bank b register ? load mode register to active command time ? last data in to read command time register values in these registers are based on the bus (hclk) period. see the lcp3250 user?s guide for more information on these registers. step 9: enable sdram clocks and clock enables and issues nops for 100 us setup the clock enables (bit 0) and clocks (bit 1) to be always active while issuing the nop command (bits 8..7) for 100 us. it is recommended to also disabled the inverted memory clock (bit 4) used for ddr mode. these are setup in the emc dynamic memory control register. step 10: issue precharge-all command setup the clock enables (bit 0) and clocks (bit 1) to be always active while issuing the precharge-all command (bits 8..7) for 10 us. note the dynamic refresh must be set to a fast rate during this command so at least a few dynamic refresh cycles occur during the 10 us period. step 11: set normal dynamic refresh timing set the emc dynamic memory refresh timer regi ster to the correct value for the optimal refresh period. step 12: issue mode word setup the clock enables (bit 0) and clocks (bit 1) to be always active while issuing the mode command (bits 8..7) in the emc dynamic memory control register. issue the mode word to the device by writing a value at the mode word address as specified in section 2.13.1 or section 2.13.2 . the value written to the address isn?t important. after the write, provide a small delay (about 1 us ) before performing any sdram operations. the mode word is used to specify the burst length and cas latency. for 32-bit interfaces, the burst length is always 1. for 16-b it interfaces, the burst length is always 2. the cas latency must match the latency programmed into the emc dynamic memory ras and cas delay 0 registers. if a device also exists on the 2 nd sdram chip select, it also needs mode word configuration. AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 32 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx step 13: issue extended mode word (low power sdram only) this step applies to low power sdram dev ices only. standard sdr devices can skip this step. setup the clock enables (bit 0) and clocks (bit 1) to be always active while issuing the mode command (bits 8..7) in the emc dynamic memory control register. issue the extended mode word to the device by writ ing a value at the extended mode word address as specified in section 2.13.1 or section 2.13.2 . the value written to the address isn?t important. after the write, provide a sm all delay (about 1 us) before performing any sdram operations. the extended mode word is usually used to specify sdram drive strength. if a device also exists on the 2 nd sdram chip select, it also needs extended mode word configuration. step 14: enter normal operational mode setup the clock enables (bit 0) and clocks (bit 1) to be de-asserted when the sdram is idle while issuing the normal command (bits 8..7) in the emc dynamic memory control register. it is recommended that the inverted memory clock (bit 4) also be disabled for sdr sdram. set the self refresh clock control (bit 3) in the register so self-refresh mode will automatically disable the sdram clock when entered. at this point, sdram should be fully operational. 3.1.2 ddr sdram programming sequence following are the typical steps necessary to program the sdram controller and a ddr sdram type device. prior to these steps, it is assumed the main system clocking has already been setup and the system is running at the desired clock rate. for this type of sdram, the bus clock (hclk) used to deriv e the sdram can run at up to 133 mhz at a ratio of ? or ? the cpu speed. note the programming sequence defined below is based on the jdec programming sequence and includes the proper steps to setup the sdram and the controller. low power and standard ddr sdram programming sequences are slightly different and have differing steps. step 1: enable emc clocking, select sd ram type, and select sdram slew rates before any accesses to the emc can occur, the emc clock needs to be enabled. the emc clock can be enabled by clearing bit 0 in the clock and power sdram clock control register. ddr sdram must also be sele cted in this register by setting bit 1. slew rates can also be set to fast or sl ow in this register with bits 22..20. step 2: enable the emc interface and set emc endian-ness the emc interface can be enabled by setting bit 0 of the emc control register. the endian mode can be selected by the emc confi guration register. in most cases, little endian mode should be used. step 3: set a long period for the dynamic refresh rate setting a long period for the dynamic refres h rate prevents the emc from constantly being in the busy status. set the emc dynamic memory refresh timer register to 0x7ff for the maximum period. AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 33 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx step 4: set the hclk command delay to 15 and select sdr memory program a hard-coded value of 15 for the command delay field (bits 18..14) in the sdram clock control register. ddr me mory is selected by setting bit 1. step 5: set the external data bus width to 16 bits (optional) although this is optional, it is recommended. when the ddr interface is used, several data bits in the upper half of the 32-bit data bus become non-functional. step 6: resynchronize ddr clocking the ddr clocks need to be resynchronized when clocks are stopped or started, or clock rates change. failure to do this may result in the sdram data becoming misaligned or swapped. to resynchronize the ddr clocks, first dis able the ddr clocking in the hclk divider control register. then toggle the ddr clock re set bit (bit 19) high and then low again in the sdram clock control register. then rest ore the ddr clocking in the hclk divider control register to either nominal or ? speed. step 7: setup address mapping setup the row/column/bank address mapping and dram type used by the interface. this can be selected with configuring the emc dy namic memory configuration 0 register. for ddr sdram, always use the low power ddr sdram value for the memory device (md) field (bits 2..0) of this register, regardless of whether standard or low power sdram is used in the system. for the address mapping (am) field (bits 14..7), select a device that matches the sdram data bus width (1-bits only) and has the same row/column/bank numbers as the sdram device(s). note the listed size for a mapping isn?t important, only the row/column/bank mapping must match for the selected data bus width. multiple configurations may exist with the same m apping, but different listed sizes. either mapping will work. if a device also exists on the 2 nd sdram chip select, it also needs address mapping to be setup in the emc dy namic memory configuration 1 register. step 8: determine nominal ring oscillator count for the current operating conditions for the current systems conditions (voltage, process, and temperate), force a few calibration runs on the ring oscillator count and save the average value into the nominal ring oscillator count. the nominal value is used as a reference against the dynamic count and is used to slightly alter ddr ti ming as voltage and temperature change. to force a calibration cycle, set and clear the sw_ddr_cal bit in the sdram clock control register. after clearing the bit, wait at least 1 us and then read the emc ddr calibration delay value register. this should be averaged over a number of samples and the average value saved in the ddr calibration nominal value register. step 9: setup ras and cas latencies setup the ras and cas latencies in the emc dynamic memory ras and cas delay 0 register. note the cas latency supports ? clock latencies. for low power ddr sdram devices, the cas latency must be setup in full clock cycles and bit 7 in the cas latency field must always be 0. for standard ddr sdram devices, cas latencies in ? clock values are allowed. if a device also exists on the 2 nd sdram chip select, it also needs cas and ras latency to be setup in the emc dynamic memory ras and cas delay 1 register. AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 34 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx step 10: setup the sdram command and read strategy this can be setup ion the emc dynamic memory read configuration register. for the ddr_drd field, the ?command delayed by command_delay time? must be used. for low power ddr systems, the ddr_drp field should be setup for read data negative capture polarity. for standard power ddr syst ems, the ddr_drp field should be setup for read data positive capture polarity. step 11: setup interface timing setup the interface timing parameters fo r the sdram device in the emc dynamic memory timing registers. these registers control the number of bus clocks cycles a specific timing value is delayed. the value for these registers van be obtained from the user?s guide or datasheet for the sdram devic e. a list of the registers that need to be setup is shown below: ? precharge command period register ? active to precharge command period register ? self-refresh exit time register ? write recover time register ? active to active command period register ? exit self-refresh to active command register ? active bank a to active bank b register ? load mode register to active command time ? la st data in to read command time register values in these registers are based on the bus (hclk) period. see the lcp3250 user?s guide for more information on these registers. step 12: enable sdram clocks and clock enables and issues nops for 200 us setup the clock enables (bit 0) and clocks (bit 1) to be always active while issuing the nop command (bits 8..7) for 200 us. these are setup in the emc dynamic memory control register. step 13: issue precharge-all command setup the clock enables (bit 0) and clocks (bit 1) to be always active while issuing the precharge-all command (bits 8..7) for 10 us. note the dynamic refresh must be set to a fast rate during this command so at least a few dynamic refresh cycles occur during the 10 us period. step 14: issue extended mode word (standard ddr only) this step applies to standard ddr devices only and is used to enable the dll. setup the clock enables (bit 0) and clocks (bit 1) to be always active while issuing the mode command (bits 8..7) in the emc dynamic memory control register. issue the extended mode word to the device by writ ing a value at the extended mode word address as specified in section 2.13.1 or section 2.13.2 . the value written to the address isn?t important. after the write, provide a sm all delay (about 1 us) before performing any sdram operations. the extended mode word is usually used to specify sdram drive strength and enable the sdram dll. AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 35 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx if a device also exists on the 2 nd sdram chip select, it also needs extended mode word configuration. step 15: set normal dynamic refresh timing (low power ddr only) this step applies to low power ddr devices only. set the emc dynamic memory refresh timer regi ster to the correct value for the optimal refresh period. step 16: issue mode word setup the clock enables (bit 0) and clocks (bit 1) to be always active while issuing the mode command (bits 8..7) in the emc dynamic memory control register. issue the mode word to the device by writing a value at the mode word address as specified in section 2.13.1 or section 2.13.2 . the value written to the address isn?t important. after the write, provide a small delay (about 1 us ) before performing any sdram operations. the mode word is used to specify the burst length and cas latency. for 16-bit interfaces, the burst length is always 2. the cas latency must match the latency programmed into the emc dynamic memory ras and cas delay 0 registers. if a device also exists on the 2 nd sdram chip select, it also needs mode word configuration. note: standard ddr systems issue the mode word with the sdram dll reset command. this doesn?t apply to low power ddr systems. step 17: issue extended mode word (low power ddr only) this step applies to low power ddr devices only. setup the clock enables (bit 0) and clocks (bit 1) to be always active while issuing the mode command (bits 8..7) in the emc dynamic memory control register. issue the extended mode word to the device by writ ing a value at the extended mode word address as specified in section 2.13.1 or section 2.13.2 . the value written to the address isn?t important. after the write, provide a sm all delay (about 1 us) before performing any sdram operations. the extended mode word is usually used to specify sdram drive strength. if a device also exists on the 2 nd sdram chip select, it also needs extended mode word configuration. step 18: issue precharge-all command (standard ddr only) setup the clock enables (bit 0) and clocks (bit 1) to be always active while issuing the precharge-all command (bits 8..7) for 10 us. note the dynamic refresh must be set to a fast rate during this command so at least a few dynamic refresh cycles occur during the 10 us period. step 19: set normal dynamic refresh timing (standard ddr only) this step applies to standard ddr devices only. set the emc dynamic memory refresh timer regi ster to the correct value for the optimal refresh period. step 20: re-issue mode word with dll reset clear (standard ddr only) setup the clock enables (bit 0) and clocks (bit 1) to be always active while issuing the mode command (bits 8..7) in the emc dynamic memory control register. issue the mode word to the device by writing a value at the mode word address as specified in AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 36 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx section 2.13.1 or section 2.13.2 . the value written to the address isn?t important. after the write, provide a small delay (about 1 us ) before performing any sdram operations. this operation is a repeat of step 16 ex cept with the sdram dll reset clear. if a device also exists on the 2 nd sdram chip select, it also needs mode word configuration. step 21: enter normal operational mode setup the clock enables (bit 0) and clocks (bit 1) to be de-asserted when the sdram is idle while issuing the normal command (bits 8..7) in the emc dynamic memory control register. set the self refresh clock control (bit 3) in the register so self-refresh mode will automatically disable the sdram clock when entered. at this point, sdram should be fully operational, although calibration hasn?t yet been enabled. step 21: setup ddr calibration ddr calibration is explained in section 3.2.2 . 3.1.3 sdr and ddr sdram setup example code nxp provides a common driver library (cdl ) that contains comprehensive startup and sdram initialization code for bringing up new boards. it is highly recommended to use the sdram initialization code included with the lpc32x0 common driver library (cdl) to initialize sdram and the sdram controller. in addition to the startup and sdram initializat ion code, the cdl provides an application called the stage 1 loader (s1l) that helps with debugging sdram issues. see section 3.3.3 for an example of the sdram debugging support features of s1l. see the documentation included in the cdl on how to use the sdram initialization code. the cdl is available on nxp?s website. 3.2 sdram operational notes 3.2.1 c hanging system clocking modes the lpc32x0 supports 3 clocking mo des: run, direct-run, and stop. in run mode, the main system clocks for the cpu and busses are derived from the pll and the system runs at full speed. this is the normal operation of the part. in direct-run mode, the main systems cloc ks for the cpu and busses are derived the system oscillator and run at a reduced speed to reduce system power. in this mode, the cpu and bus clocks run at the same rate. since the bus has to operate at ? or ? the cpu clock rate for ddr operation, ddr will not work in this mode. in stop mode, the system cl ocks are disabled. the cpu and bus clocks are off. sdram devices must be placed into self-refresh mode for their data to remain valid. entering stop mode, or returning to run mode from st op mode requires a transition through direct- run mode. 3.2.1.1 changing clock rates and sdram impact any change to the pll to adjust system cloc k rates requires the system to enter direct- run mode, change the pll rate, and then re-enter run mode. any change to the bus rate will require the sdram interface and refresh timings to be adjusted to the new clock rate. AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 37 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx 3.2.1.2 sdram operation in direct-run mode as ddr devices require the bus clock to be ? or ? of the cpu clock speed and direct- run mode uses the same clock for the cpu and bus, ddr devices will not work correctly in direct-run mode. if using ddr memory and sw itching into direct-run mode to bring the system down or change clock rates, the co de and data used for the cpu must not be executing from sdram. sdr sdram systems do not have this limitation. note: the linux port shows how to enter stop mode from run mode and safely place a ddr based system into full suspend. 3.2.1.3 self-refresh mode entering self-refresh mode slightly varies for sdr and ddr sdra m devices. regardless of which device is used, the system must not be accessing sdram when self-refresh mode is entered. accesses include code and data accesses, dma operations, cache flush and fill operations, or mmu translation table accesses. the following sequence can be used to place sdram into self-refresh mode for both sdr and ddr sdram based systems: step 1: jump to code in iram for entry of sdram self-refresh mode since sdram will not operate correctly when placed into self-refresh mode, the code to place the sdram into self-refresh needs to be executed from iram. this means both code and data. if using the mmu, make sure caches and translation buffer are completely flushed to sdram. step 2: verify the self-refresh clock is programmed to stop during self-refresh mode verify bit 3 in the emc dynamic memory cont rol register is set. th is will automatically disable the sdram clocks when self-refresh is entered. step 3: wait for the sd ram controller to go idle the sdram controller may be in the process of refreshing sdram, so a wait may be necessary before altering t he sdram controller?s operat ion. wait for the sdram controller to go busy and then idle before continuing to the next step. step 4: enter self-refresh mode set bit 9 in the clock and power control register at address 0x40004044. with bit 9 remaining set, also set bit 8. with bit 9 remaining set, clear bit 8. wait for the self-refresh acknowledge by monitoring bit 2 of the emc st atus register at address 0x31080004. bit 2 will be set when the drams are in self-refresh mode. the drams are now in self-refresh mode and the chip can be placed into direct-run or stop modes without effecting sdram status. to exit self-refresh mode, use the following sequence: clear bit 9 in the clock and power control register at address 0x40004044. with bit 9 remaining clear, set bit 8. with bit 9 remaini ng clear, clear bit 8. wait for the self-refresh exit by monitoring bit 2 of the emc status register at address 0x31080004. bit 2 will be clear when the drams have exited self-refresh mode. 3.2.2 d dr sdram calibration chip development process, board design, core voltage, and environmental factors can affect the operational timing of the ddr interface. with ddr sdram?s high speed access requirements, these fa ctors can have a negative impact on ddr data timing. to AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 38 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx help maintain optimal ddr timing under these va rious factors, the lpc32x0 provides the capability to alter ddr timing based on the current core process, voltage, and temperature (pvt). the intention of this mechanism is to allow the ddr timing to remain optimal as the pvt factors change. calibration is the process of finding the best calibration coefficients for a baseline ddr operating condition. for example, the calibrati on can be based on a typical chip process, standard core voltage (1.2 v), and when the chip temperature is at 30 c. once correctly calibrated for this base line condition, the chip will adju st ddr timing as needed as the voltage and temperature change. note the process will not vary over time fo r a specific part, although different parts may have slightly different processes. 3.2.2.1 lpc32x0 ddr calibration functionality the hardware interface between the emc and ddr sdram is source synchronous. this means whichever device is driving the data is also driving the clock (dqsx), and the receiver interface uses the dqsx to latc h the accompanying data. the emc drives data and dqsx in the case of writes to ddr, wh ile the ddr supplies data and dqsx in case of reads. during writes, the emc center alig ns the dqsx within the data valid window, enabling the ddr to use the dqsx transitions to directly latch the data. however, during reads the ddr edge aligns the dqsx transitions with the data valid window. the emc must delay the dqsx enough to meet internal setup and hold times for latching the data. the end function of the calibration hardware is to alter the read timing used to latch data from the ddr sdram devices. the lpc32x0 ca libration support consists of a ring oscillator, ring oscillator refere nce, calibration sensitivity settings, calibration update logic, un-calibrated dqs delay, and calibrated dqs delay. the ring oscillator is used to monitor the current voltage and temperature and may vary based on chip process. the operation of this oscillator is to provide a count over one peripheral clock period (typically about 77 ns ). the count will vary over time as voltage and temperature change. the chip process w ill also have some impact on count of this oscillator. for example, a chip at 1.2 v core voltage may generate about 32 counts per peripheral clock period, while a chip at 1.3 v may generate about 38 counts per period. the user?s guide refers to th is register as ddr_lap_count. the ring oscillator reference is used to generate a difference against the ring oscillator. as the ring oscillator count ch anges over time, the referenc e will remain stable at its calibrated value. the difference between the ring oscillator count a nd the ring oscillator reference count is used for timing adjustment. the user?s guide refers to ring oscillator reference register as ddr_lap_nom. the un-calibrated dqs delay is in the ddr_dqsin_delay field in the sdram clock control register. this value is used for dqs read timing when calibration is disabled or as the starting point when calibration is enabled. the calibrated dqs delay is in the ddr_ cal_delay register. this value is the computed dqs read delay when calibration is en abled. the value in this register is determined from the un-calibrated dqs delay , sensitivity_factor, and difference between the ring oscillator count and ring oscillator reference. the sensitivity_factor field in the sdram cl ock control register is used with the ddr_dqsin_delay field to control the calibrated dqs delay. the value programmed into this register is directly based on the value used for the un-calibrated dqs delay. see the emc/ddr dqs delay calibration section in the lcp32x0 user?s guide for the mapping of sensitivity_factor to ddr_dqsin_delay. AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 39 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx calibration logic is controlled by the cal_delay, sw_ddr_cal, and rtc_tick_en bits in the sdram clock cont rol register. if the rtc_tick _en bit is set, then the ring oscillator count will be re-eva luated every second (based on rtc tick). a ring oscillator count update can be forced by setting and cl earing the sw_ddr_cal at any time. the cal_delay bit controls whether calibrated settings are used. if cal_delay is set, the value in the ddr_cal_delay register is used for dqs read timing. if it is not set, the value in the ddr_dqsin_delay in the sdram clock control register is used for dqs read timing. note that the command_delay field in the sdram clock control register is also based on calibrated settings. however, the values in this register have little to no effect on ddr operation and this field should alwa ys be programmed to the value 15 for ddr systems. 3.2.2.2 calibration coefficients and storage the following data is needed to setup d dr sdram calibration in the hardware: ? nomina l ring oscillator count at a specif ic voltage/temperature point on the system ? optima l un-calibrated dqs delay values at the same voltage/temperature point this calibration can be handled and retrieved in a number of different ways: reset/power cycle calibration (on the fly) the ddr calibration can be performed for the system each time the system is powered up or reset. this has the advantage of calibrating the chip for the current environment the system is operating in, including temperature and voltage, and is easy to implement, but can add a little time to the ddr sdram init ialization. current example code in the cdl provided by nxp uses this method. calibration to a specific system design the average calibration data can be determined for a specific system design and that data can be used in the code across all products with the same design. this has the advantage of a fast boot time, but the oc casional board may fall out of the average calibration data and may not be reliable. ?per board? stored calibration data calibration can be performed on each individual board at power-up or reset if calibration data doesn?t already exist. the calibration data is usually stored in some non-volatile location in the system and be retrieved and used on later power cycles or resets. this has the advantage of optimal calibration for each board and fast boot, but requires some non-volatile store for the calibration data. 3.2.2.3 calibration method once the ddr sdram has been initialized and is running normally, calibration can be performed to find the optimal timings. calibration consists of running short memory tests at various dqs delay values while the calibration hardware is disabled. calibration hardware is disabled by clearing bit 9 in the sdram clock control register. a minimum and maximum working dqs delay value is obtained and the average is used as the optimal un-calibrated dqs delay value. for the current operating conditions, this value will allow optimal ddr timing when calibra tion is off. this value is obtained for the current temperature and core voltage of the chip. the ring oscillator count is then updated and it s count is used as the reference count in the ring oscillator reference register. it is recommended that the ri ng oscillator count be AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 40 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx updated and captured a number of times to get an average working value. wide variations in ring oscillator count are indica tive of a possible problem with the board. after the ring oscillator reference and un-cal ibrated dqs delay value is determined, the sensitivity factor is set and then calibration is enabled. the general steps for calibration are as follows. ddr sdram must be initialized to normal operational mode prior to running calibration. this includes loading the command_delay field in the sdram clock control register to 15. step 1: use pre-existing calibration data if it exists if calibration data is already stored somewhere, then load the saved values and skip to step 5. stored calibration consists of an optimal un-calibrated dqs delay value and the average ring oscillator count for that value. step 2: disable calibration verify that calibration logic is not enabl ed. this can be disabled by clearing the cal_delay bit in the sdra m clock control register. step 3: determine the av erage ring oscillator value perform a ring oscillator count update by setting and clearing the sw_ddr_cal bit in the sdram clock control register. a sma ll delay (about 200 ns) is needed after the update request to allow the ring oscillator coun t to properly update. this update should be performed more than once and the average used. the ring oscillator count is read from the ddr_lap_count register. if the count varies widely during the updates and reads, then the core voltage supply may be noisy or problematic and needs to be checked. once a good average working value is obtained, store the value in the ring oscillator reference r egister (ddr_lap_nom). see section 3.2.2.4 for some examples of these counts under varying conditions. step 4: determine minimum and maximum dqs delay working values adjust the ddr_dqsin_delay field in the sdram clock control register between 0 and (up to) 32 and run brief memory tests for each value. a working range of dqs delay values will be obtained where the memory test s pass without errors. using the average of this range gives a good optimal un-calibrated dqs delay value. see section 3.2.2.4 for some examples of this range under varying conditions. step 5: set un-calibrated dqs delay this computed average dqs delay value computed in step 4 or loaded from stored calibration data in step 1 should be programmed into the ddr_dqsin_delay field in the sdram clock control register. step 6: for the value programmed into the ddr_dqsin_delay field (in step 5), program the corresponding value into the sensitivity_factor field in the sdram clock control register based on the lpc32x0 user?s guide. for example, if ddr_dqsin_delay is 7, t he program that must be programmed into the sensitivity_factor field is 2. step 7: set the ring oscillator reference value this average ring oscillator count computed in step 3 or loaded from stored calibration data in step 1 should be programmed into the ring oscillator reference register (ddr_lap_nom). AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 41 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx step 8: enable calibration a nd automatic ring oscillator update enable the calibration logic and the ring oscillator update logic by setting bits cal_delay and rtc_tick_en in the sdram clock control register. step 9: store calibrati on data (optional) save the un-calibrated dqs delay and the ring oscillator reference value in non-volatile store for future re-calibration. 3.2.2.4 example calibration values the calibration values and ranges for t hese example systems were obtained from nxp validation boards. actual values depending on board design, power supply stability, the sdram device, and the lpc32x0 chip. values were obtains using s1l. calibration data results for the mobile and standard ddr were from different boards using different lpc3250 chips. system: lpc3250 mobile ddr module (validation board), 1.20 v core, 25 c clocks: 208 mhz cpu, 104 mhz sdram, 13 mhz peripheral clock sdram: part # mt46h32m16lfck-6 conf igured at ras of 2 and cas of 3 un-calibrated dqs value range = 2 to 16 un-calibrated nominal dqs value = 9 ring oscillator count range = 33 to 37 system: lpc3250 mobile ddr module (validation board), 1.35 v core, 25 c clocks: 208 mhz cpu, 104 mhz sdram, 13 mhz peripheral clock sdram: part # mt46h32m16lfck-6 conf igured at ras of 2 and cas of 3 un-calibrated dqs value range = 2 to 18 un-calibrated nominal dqs value = 10 ring oscillator count range = 41 to 45 system: lpc3250 mobile ddr module (validation board), 1.35 v core, 25 c clocks: 266 mhz cpu, 133.25 mhz sd ram, 13.325 mhz peripheral clock sdram: part # mt46h32m16lfck-6 conf igured at ras of 2 and cas of 3 un-calibrated dqs value range = 2 to 13 un-calibrated nominal dqs value = 7 ring oscillator count range = 40 to 43 AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 42 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx system: lpc3250 standard ddr module (validation board), 1.20 v core, 25 c clocks: 208 mhz cpu, 104 mhz sdram, 13 mhz peripheral clock sdram: part #mt46v32m16bn-6 configured at ras of 2 and cas of 2-1/2 un-calibrated dqs value range = 2 to 12 un-calibrated nominal dqs value = 7 ring oscillator count range = 32 to 34 system: lpc3250 standard ddr module (validation board), 1.35 v core, 25 c clocks: 208 mhz cpu, 104 mhz sdram, 13 mhz peripheral clock sdram: part #mt46v32m16bn-6 configured at ras of 2 and cas of 2-1/2 un-calibrated dqs value range = 2 to 17 un-calibrated nominal dqs value = 9 ring oscillator count range = 40 to 42 system: lpc3250 standard ddr module (validation board), 1.35 v core, 25 c clocks: 266 mhz cpu, 133.25 mhz sd ram, 13.325 mhz peripheral clock sdram: part #mt46v32m16bn-6 configured at ras of 2 and cas of 2-1/2 un-calibrated dqs value range = 2 to 8 un-calibrated nominal dqs value = 5 ring oscillator count range = 32 to 41 3.3 common programming problems most issues related to sdram operation are due to incorrect programming of the sdram devices during setup. 3.3.1 sdr and ddr sdram problems many sdram problems occur during the initia l setup of the sdram device. incorrectly programmed mode words that do not match t he emc?s cas and ras delay or the burst size are common mistakes. another common mi stake is the comput ation of the address used to program the mode word. the programmed mode address depends on the number of columns and banks on the sdram de vice, the bus width (16 or 32 bits), and the addressing strategy (rbc or brc). another common problem is that some compilers may aggressively optimize generated machine code that removes some operations. for the following operation, most compilers will generate working code that per forms the operation. but if the volatile modifier isn?t used, the code may not appear in the executable code. * (volatile unsigned long *) (0x80000000 + (0x18 << (10 + 2 + 2))) = 0; in some cases, the bank address pins ba0 and ba1 are swapped. for extended mode register operations, this has to be considered. see section 2.12 for more information on these special cases. AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 43 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx 3.2.3 ddr sdram problems ddr sdram devices require clock synchronizati on and calibration in the emc to work correctly. data integrity issues or word sw apping are usually indications that the clocks are not correctly synchronized or calibration isn?t optimal. if words are swapped on read back of the dat a from the ddr sdram device, the most likely problem is that the emc and sdram cl ocks are not correctly synchronized. when using ddr sdram and when clocks are enabled in the emc, the ddr clocks must be synchronized. this applies to ddr sdram whenever the clock state is changed, e.g., when switching from direct-run mode to run mode, changing the ddr clock divider, or restarting any emc clocks. failure to perfo rm this important operation may sometimes cause the word swapping issue. the ddr clock re-synchronization can be performed as follows: 1. disable dram clocking in the hclk divider control register 2. se t and unset the ddr reset bit (bit 19) in the sdram clock control register 3. restore dram clocking in the hclk divi der control register. the system must be in run mode with the bus (hclk) rate ? or ? the cpu clock rate. 3.2.4 sdram initialization and debugging features included in the lpc32x0 cdl the lpc32x0 cdl includes sdram initia lization code based on the jedec sdram initialization sequence. the code is designed to help simply sdram setup handling most of the sdram controller setup and sdram pr ogramming sequence. in most cases, the code will work ?as is? requiring only changing the definitions used to define the sdram device connected to the system. an application called the stage 1 loader (s1l ) code can be built and deployed to the board using the serial loader tool. the serial loader tool provides a simple method to download an image to the board using just t he serial port. s1l provides a monitor function through the serial port for testing and debugging sdram operation. a sample session of s1l using a mobile dd r sdram configuration is shown below. the sdram definitions have been pr e-configured for correct operation on a board using a core voltage of 1.35v. the ?info? command can be used to examine the sdram initialization values, geometry, some calibration data, and clock setup. arm system clock (hz) = 266500000 hclk (hz) = 133250000 peripheral clock (hz) = 13325000 rows/columns/bank bits : 0xd/0xa/0x2 sdram size (bytes) : 0x04000000 32-bit bus : 0x0 dram performance mode : 0x1 sdram address mapping : 0x11 mode shift value : 0x0d bank shift value : 0x0b mode write address : 0x80062000 ext mode write address : 0x80000800 mode word rrrrrrrrrrrrr bb cccccccccc 0 0000000110001 00 0000000000 0 ext mode word rrrrrrrrrrrrr bb cccccccccc 0 AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 44 of 47
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 45 of 47 0000000000000 01 0000000000 0 uncalibrated dqs min : 0x00000002 uncalibrated dqs max : 0x0000000d the ?rosci? command can be used to examine the typical ring oscillator count range for the current environment. 32x0>rosci min / max ring oscillator counts: 40 / 43 current nominal count: 42 memory bandwidth tests can be performed with the ?bwtest? command to get an idea of memory transfer bandwidth. testing wi th the low power and high performance addressing modes can be dynamically sw itched with the ?rbswap? command. 32x0>bwtest 0x80000000 0x80000000 32000000 10 bandwidth test complete number of bytes transferred:640000000 timer ticks to transfer :62064392 timer rate (ticks/sec) :13325000 memory tests can be performed with the ?memtst? command. various memory tests are available. 32x0>help memtst command: memtst purpose: performs 1 or more memory tests syntax: memtst [hex address][bytes to test][1, 2, or 4 bytes][0(all) - 5][iterations] 32x0>memtst 0x80000000 64000000 1 1 1 starting walking 1 test address :0x80000000 bytes :64000000 width (bytes):1 starting test....verifying data....test passed
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx AN10935 all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2010. all rights reserved. application note rev. 2 ? 11 october 2010 46 of 47 4. legal information 4.1 definitions draft ? the document is a draft version only. the content is still under internal review and subject to formal approval, which may result in modifications or additions. nxp semiconductors does not give any representations or warranties as to the accuracy or completeness of information included herein and shall have no liability for the consequences of use of such information. 4.2 disclaimers limited warranty and liability ? information in this document is believed to be accurate and reliable. however, nxp semiconductors does not give any representations or warranties, expressed or implied, as to the accuracy or completeness of such informatio n and shall have no liability for the consequences of use of such information. in no event shall nxp semiconductors be liable for any indirect, incidental, punitive, special or consequential damages (including - without limitation - lost profits, lost savings, business inte rruption, costs related to the removal or replacement of any products or re work charges) whether or not such damages are based on tort (including negligence), warranty, breach of contract or any other legal theory. notwithstanding any damages that cu stomer might incur for any reason whatsoever, nxp semiconductors? aggregate and cumulative liability towards customer for the products described herein shall be limited in accordance with the terms and condi tions of commercial sale of nxp semiconductors. right to make changes ? nxp semiconductors reserves the right to make changes to information published in this document, including without limitation specifications and product de scriptions, at any time and without notice. this document supersedes and replaces all information supplied prior to the publication hereof. suitability for use ? nxp semiconductors produ cts are not designed, authorized or warranted to be suitable for use in life support, life-critical or safety-critical systems or equipment, nor in applications where failure or malfunction of an nxp semiconductors product can reasonably be expected to result in personal injury, death or severe property or environmental damage. nxp semiconductors accepts no liability for inclusion and/or use of nxp semiconductors products in such equipment or applications and therefore such inclusion and/or use is at the customer?s own risk. applications ? applications that are described herein for any of these products are for illustrative purposes only. nxp semiconductors makes no representation or warranty that such applications will be suitable for the specified use without further testing or modification. customers are responsible for the design and operation of their applications and products using nxp semiconductors products, and nxp semiconductors accepts no liability for any assistance with applications or customer product design. it is custom er?s sole responsibility to determine whether the nxp semiconductors product is suitable and fit for the customer?s applications and products planned, as well as for the planned application and use of customer?s third party customer(s). customers should provide appropriate design and operating safeguards to minimize the risks associated with their applications and products. nxp semiconductors does not accept any liability related to any default, damage, costs or problem which is bas ed on any weakness or default in the customer?s applications or products, or the application or use by customer?s third party customer(s). customer is responsible for doing all necessary testing for the customer?s applic ations and products using nxp semiconductors products in order to av oid a default of the applications and the products or of the application or use by customer?s third party customer(s). nxp does not accept any liability in this respect. export control ? this document as well as the item(s) described herein may be subject to export control regulations. export might require a prior authorization from national authorities. 4.3 trademarks notice: all referenced brands, product names, service names and trademarks are property of their respective owners.
nxp semiconductors AN10935 using sdr/ddr sdram memories with lpc32xx please be aware that important notices concerning this document and the product(s) described herein, have been included in the section 'legal information'. ? nxp b.v. 2010. all rights reserved. for more information, please visit: http://www.nxp.com for sales office addresses, please send an email to: salesaddresses@nxp.com date of release: 11 october 2010 document identifier: AN10935 5. contents 1. introduction .........................................................3 2. external memory controller ................................3 2.1 emc pins ............................................................4 2.2 maximum system sdram memory ...................6 2.3 contiguous sdram across emc_dycs0 and emc_dycs1 .....................................................7 2.4 sdram clock enable when using emc_dycs0 and emc_dycs1 ..............................................7 2.5 sdr sdram connections ..................................8 2.5.1 routing rules for sdr sdram ..........................9 2.5.2 function of emc_clkin pin ............................10 2.5.2.1 emc_clkin to compensate for long flight times .........................................................................10 2.6 ddr sdram connections ...............................11 2.7 routing rules for ddr sdram ........................13 2.7.1 function of emc_clkin pin ............................14 2.8 sdram layout optimization ..............................14 2.9 shared bus placement for sdram and static memory devices ...............................................14 2.10 address mapping between ahb address and sdr/ddr sdram ...........................................14 2.11 using 32-bit sdrams not in um10326 table 115 address mapping .............................................23 2.12 special cases connecting sdram ba[1:0] to emc_a[14:13] ..................................................23 2.13 loading the sdram mode register or extended mode register ...................................................24 2.13.1 example writing to mobile sdram mode register in 16-bit system memory ....................26 2.13.2 example writing to mobile sdram mode register in 32-bit system memory ....................27 3. sdram controller programming and operations ..........................................................30 3.1 typical sdram programming sequences .......30 3.1.1 standard and low power sdr sdram programming sequence ...................................30 3.1.2 ddr sdram programming sequence .............33 3.1.3 sdr and ddr sdram setup example code ...37 3.2 sdram operational notes ................................37 3.2.1 changing system clocking modes ....................37 3.2.1.1 changing clock rates and sdram impact .......37 3.2.1.2 sdram operation in direct-run mode ..............38 3.2.1.3 self-refresh mode .............................................38 3.2.2 ddr sdram calibration ..................................38 3.2.2.1 lpc32x0 ddr calibration functionality ............39 3.2.2.2 calibration coefficients and storage .................40 3.2.2.3 calibration method ...........................................40 3.2.2.4 example calibration values ...............................42 3.3 common programming problems .....................43 3.3.1 sdr and ddr sdram problems ....................43 3.3.2 ddr sdram problems ....................................44 3.3.3 sdram initialization and debugging features included in the lpc32x0 cdl ..........................44 4. legal information ..............................................46 4.1 definitions .........................................................46 4.2 disclaimers .......................................................46 4.3 trademarks ......................................................46 5. contents .............................................................47


▲Up To Search▲   

 
Price & Availability of AN10935

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X